Repository navigation
Conversation
Instead we: 1. first do a forward pass to first compute all the reachable type states, and then 2. define the `TypeState` type. This commit does (1). The next commit does (2).
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the constructor-forwarding analysis optimization.
No open issues 🎉
What changed in this PR
Optimizes C++ constructor-forwarding analysis to limit intermediate tuple growth during type conversions.
Changes:
- Adds
bindingsetannotations to constrain large conversion relations. - Computes forward reachability using separate state components, then constructs
TypeStatevalues only for reachable tuples. - Centralizes conversion transitions in
typeStepfor use by forward and reverse traversal.
| File | Description |
|---|---|
cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll |
Refactors forwarding-state traversal and constrains conversion relations to improve evaluation performance. |
Review effort: Max (auto)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The forwarding logic did essentially this:
but it turns out some of the
typeConversionsteps are rather large relations. So this PR puts appropriatebindingsetannotations on the large relations to prevent a tuple explosion.Additionally,
TypeStateconsisted of 4 columns (Type, ValueCategory, Boolean, Phase) which were very hard to relate in any way other than through cartesian products. To fix that, this PR also delays construction of theTypeStateuntil after thefwdphase. We can then construct theTypeStateIPA based on the tuples that are included in thefwdrelation.Commit-by-commit review recommended.
Since we don't have any non-test
forwardsmodels yet I don't think there's a need to run DCA on this PR.